package com.lucene.service;
import com.lucene.mapper.ProjectMapper;
import com.lucene.model.Page;
import com.lucene.model.Project;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zl on 2015/8/27.
 */

@Service("projectService")
public class ProjectService {

    @Autowired
    private ProjectMapper projectMapper;

    public List<Project> getAllProjects(){
        return projectMapper.getAllProjects();
    }

    public Integer queryProjectsNum(String search){
        return projectMapper.queryProjectsNum(search);
    }

    public int delProject(Project project){
        return projectMapper.delProject(project);
    }

    public int addProject(Project project){
        return projectMapper.insertProject(project);
    }

    public int updateProject(Project project){
        return projectMapper.updateProject(project);
    }
    public int updateProjectGroup(Project project){
        return projectMapper.updateProjectGroup(project);
    }

    public Project searchProjectByKey(Project project){
        return projectMapper.searchByKey(project);
    }

    public List<Project> queryProjects(Project project){
        return projectMapper.queryProjects(project);
    }

    public Project queryProjectById(Project project){
        return projectMapper.queryProjectById(project);
    }

    public List<Project> queryProjectByPage(Page page){
        return projectMapper.queryProjectByPage(page);
    }
}
